<template>
  <div class="about">
    <h1>This is an about page</h1>
  </div>
  <div>
    <button @click="log">TestAxios</button>
    <p>{{ data }}</p>
  </div>
</template>

<script>
export default {
  data(){
    return {
      data: null
    }
  },
  mounted(){
    this.initData()
  },
  methods: {
    initData(){
      this.$api.get('/api/login/index').then(res => {
        this.data = JSON.stringify(res.data);
      }).catch(err => {
        console.log(JSON.stringify(err));
        return;
      });
    },
    log(){
      this.initData();
      console.log(this.data);
    }
  }
}
</script>
<style>

</style>

